package com.example.monitor;

import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator on 2017/1/11 0011.
 */
@Component
public class MyHealth implements HealthIndicator {

    @Override
    public Health health() {
//        int errorCode = check(); // perform some specific health check
        int errorCode =0;
        if (errorCode != 0) {
            return Health.down().withDetail("Error Code", errorCode).build();
        }
        return Health.up().build();
    }
}